Fix network-interface-list|info on newer BSD derived OS:es.
authorJan D. <jan.h.d@swipnet.se>
Sat, 13 Aug 2011 10:48:03 +0000 (12:48 +0200)
committerJan D. <jan.h.d@swipnet.se>
Sat, 13 Aug 2011 10:48:03 +0000 (12:48 +0200)
commit3cb1cf3e8dce7f4a72c2f087b9800f2f1ae58495
treea9f62b34a8e648dbea41633197dbbf76052ceb28
parent184023840f362ea63d9c1b2d520abf51170758ea
Fix network-interface-list|info on newer BSD derived OS:es.

* configure.in: Add header check: sys/socket.h,
ifaddrs.h, net/if_dl.h.  Check for getifaddrs and freeifaddrs.
Check for sa_len in struct ifreq.ifr_addr (Bug#8477).

* src/process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
(Fnetwork_interface_list): Allocate in increments of bytes instead
of sizeof (struct ifreq).  Iterate over ifconf.ifc_req by counting
bytes (Bug#8477).  Count bytes correctly when ifr_addr is a struct
sockaddr.
(struct ifflag_def): notrailers is smart on OSX.
(Fnetwork_interface_info): Handle case when ifr_flags is negative.
Get hardware address with getifaddrs if available.
ChangeLog
configure.in
src/ChangeLog
src/process.c